package com.sk.z.khk.googleplace;

public class GPURLParamMaker {
	private static GPURLParamMaker instance;
	private String sensor = "false";
	private String key = "AIzaSyBY0TvzeWn_O6TshmzWEe7XhkXoPIHyNDM";
	private String radius = "200";
	private String language = "ko";
	static {
		instance = new GPURLParamMaker();
	}

	private GPURLParamMaker() {

	}

	public static GPURLParamMaker getInstance() {
		return instance;
	}

	public GPURLParam getGPURLParam() {
		return new GPURLParam() {
			private String types;
			private String longitude;
			private String latitude;
			private String name;

			@Override
			public void setTypes(String types) {
				this.types = types;
			}

			@Override
			public void setName(String name) {
				this.name = Encoder.urlEncoding(name);
			}

			@Override
			public void setLongitude(String longitude) {
				this.longitude = longitude;
			}

			@Override
			public void setLatitude(String latitude) {
				this.latitude = latitude;
			}

			@Override
			public String getTypes() {
				return types;
			}

			@Override
			public String getSensor() {
				return sensor;
			}

			@Override
			public String getRadius() {
				return radius;
			}

			@Override
			public String getName() {
				return name;
			}

			@Override
			public String getLongitude() {
				return longitude;
			}

			@Override
			public String getLatitude() {
				return latitude;
			}

			@Override
			public String getLanguage() {
				return language;
			}

			@Override
			public String getKey() {
				return key;
			}

			@Override
			public String toString() {
				return "location=" + latitude + "," + longitude + "&"
						+ "radius=" + radius + "&" + "language=" + language
						+ "&" + "sensor=" + sensor + "&"
						+ (types == null ? "" : ("types=" + types + "&"))
						+ (name == null ? "" : ("name=" + name + "&")) + "key="
						+ key;
			}
		};
	}
}
